package xxx.core.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xxx.core.objmapping.StudentMapping;
import xxx.core.repository.StudentRepository;
import xxx.pojo.entity.Student;
import xxx.pojo.vo.StudentVo;

/**
 * @author yuanchengman
 * @date 2021-08-16
 */
@Service
public class StudentService {

    @Autowired
    private StudentRepository studentRepository;

    public StudentVo getByName(String studentName){
        Student student = studentRepository.getByName(studentName);
        return StudentMapping.INSTANCE.toVo(student);
    }
}
